<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
</head>

<body>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.parseTapmode();
        var ns = window.Foresight.Util;
        var uid = api.getPrefs({
            sync: true,
            key: 'uid'
        });
        var apiUrl = CONFIG.apiurl;
        var apiOption = ns.getAPIUrl();
        if (apiOption) {
            apiUrl = apiOption.apiUrl;
        }
        apiUrl = apiUrl.toLowerCase().replace('mobile/api.ashx', 'webapi/open-api/phone/encrypt');
        api.ajax({
            url: apiUrl,
            method: 'post',
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
            data: {
                body: {
                    uid: uid
                }
            }
        }, function (ret, err) {
            if (ret) {
                if (ret.code == 200) {
                    var headerH = api.pageParam.header_h;
                    var frameH = api.winHeight;
                    ns.openFrame('outside_study_chrome_frm', {
                        header_h: headerH,
                    }, {
                        rect: {
                            x: 0,
                            y: headerH - 1,
                            w: 'auto',
                            h: frameH - headerH,
                        },
                        url: 'https://dangjian.edangjian.com//mobilemainpageforthirdparty/portalDefault.action?companyID=399820709231219635150936&accessToken=' + ret.data.accessToken
                    });
                    return;
                }
            } else {
                api.alert({ msg: JSON.stringify(err) });
            }
        });
    };
    function closeWin() {
        api.closeWin();
    }
</script>

</html>